﻿@using MvcAtletIS.Helpers;
@model IEnumerable<MvcAtletIS.Models.Webcontacts>
@{
    ViewBag.Title = "Kontakty";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@section head {

    <link href="@Url.Content("~/footable/css/footable.core.css")" rel="stylesheet" type="text/css" />
    <link href="@Url.Content("~/footable/css/footable.standalone.css")" rel="stylesheet" type="text/css" />
  
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/footable/js/footable.sort.js")" type="text/javascript"></script>
    
    <script type="text/javascript">
        $(function () {
            $("table").footable();
        });
    </script>
}

<h2>Kontakty</h2>

<p>
    <b>Slovenský atletický zväz</b> <br />
    Bajkalská 7A <br />
    831 04 Bratislava <br />
    <br />
    Telefón: +421 2 38 15 55 00 <br />
    E-mail: <a href="mailto:saz@atletikasvk.sk">saz@atletikasvk.sk</a>
</p>

<!-- --------- FILTER ---------- -->
@using (Html.BeginForm())
{ 
    <div class="filter-frame">
        
        <div class="filter-item">
            <div class="editor-label">
                Vyberte kategóriu kontaktov
            </div>
            <div class="editor-field">
                @Html.DropDownList("CategoryId", null, null, new { onchange = "this.form.submit();" })
            </div>
        </div>

    </div>
}

<table class="footable table toggle-arrow-tiny">
    <thead>
        <tr>
            <th width="300px" data-class="expand" data-type="numeric">
                Priezvisko
            </th>
            <th width="300px">
                Meno
            </th>
            <th>
                Funkcia
            </th>
            <th data-hide="phone,tablet">
                Foto
            </th>
            <th data-hide="phone,tablet">
                Email
            </th>
            <th data-hide="phone,tablet">
                Telefón
            </th>
            <th data-hide="phone,tablet">
                Mesto
            </th>
            <th data-hide="phone,tablet">
                Adresa
            </th>
            <th width="30px" data-sort-ignore="true"></th>
        </tr>
    </thead>
    <tbody>
    @foreach (var item in Model) 
    {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.Surname)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Firstname)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Position)
            </td>
            <td>
                <img src="@Url.Content("~/Content/contacts/" + item.ImagePath)" alt="contact" width="80" />
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Email)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Phone)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.City)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Adress)
            </td>
            <td align="center">
                @Html.ImageActionLink(Url.Content("~/Content/icons/preview.gif"), "", "Detail", new { id = item.ID }, new { title = "Zobraziť", border = 0, hspace = 2 }) 
            </td>
        </tr>
    }
    </tbody>
</table>